 function StudentIndex() {
    var _this = this;
    var page,page1,page2,page3;
    var page_size=10;
    var obj;
    var proType = "online";

    //初始化
    _this.init = function (page_,page_1,page_2,page_3) {
        page = page_;
        page1 = page_1;
        page2 = page_2;
        page3 = page_3;
        _this.student_classHour_tj();
        _this.student_tj();
        _this.initTable();
        _this.initTable_public();
        _this.click();
        _this.handlerPublish();
    }

    //点击事件
    _this.click = function () {
        //搜索(线上任务)
        $("#search").click(function(){
          $("#projectName").val($.trim($("#projectName").val()));
            _this.initTable($("#isFixedCycle").val());
        })
        //全部(线上任务)
        $("#search_all").click(function(){
            $("#projectName").val("");
            $("#startTime").val("");
            $("#endTime").val("");
            $(".status:eq(0)").trigger("click");
        })
        //搜索(线下任务)
        $("#off_search").click(function(){
            $("#off_projectName").val($.trim($("#off_projectName").val()));
            _this.initOffTable();
        })
        //全部(线上任务)
        $("#off_search_all").click(function(){
            $("#off_projectName").val("");
            $("#off_startTime").val("");
            $("#off_endTime").val("");
            _this.initOffTable();
        })
        //状态搜索
        $(".status").each(function(){
            var $this = this;
            $($this).click(function(){
                $("#projectStatus").val($($this).attr("project_status"));
                $(".status").removeClass("active");
                $($this).addClass("active");
                _this.initTable($("#isFixedCycle").val());
            })
        });
        //集中培训状态搜索
        $(".center_status").each(function(){
            var $this = this;
            $($this).click(function(){
                $("#center_projectStatus").val($($this).attr("center_status"));
                $(".center_status").removeClass("active");
                $($this).addClass("active");
                _this.initCenterTable();
            })
        });
        //（全部）集中培训搜索
        $("#center_search_all").click(function(){
            $("#center_projectName").val("");
            $("#center_startTime").val("");
            $("#center_endTime").val("");
            $(".center_status:eq(0)").trigger("click");
        })

        //搜索(集中培训)
        $("#center_search").click(function(){
            $("#projectName").val($.trim($("#center_projectName").val()));
            _this.initCenterTable();
        })

        //搜索(公开项目)
        $("#public_search").click(function(){
            $("#public_projectName").val($.trim($("#public_projectName").val()));
            _this.initTable_public();
        })
        //全部(公开项目)
        $("#public_search_all").click(function(){
            $("#public_projectName").val("");
            $("#public_startTime").val("");
            $("#public_endTime").val("");
            $(".public_status:eq(0)").trigger("click");
        })
        //状态搜索(公开项目)
        $(".public_status").each(function(){
            var $this = this;
            $($this).click(function(){
                $("#public_projectStatus").val($($this).attr("public_status"));
                $(".public_status").removeClass("active");
                $($this).addClass("active");
                _this.initTable_public();
            })
        });
    }

    //学员统计
    _this.student_classHour_tj = function () {
        var url = appPath + "/student/student_classHour_tj";
        $.ajax({
            url: url,
            async: false,
            type: "post",
            dataType:"json",
            success:function(data){
                var code = data['code'];
                if(10000 == code){
                    var result0 = data['result'];
                    $("#ndxs").html(TimeUtil.getHour(result0['year_studytime'])+"小时");
                    $("#ljxs").html(TimeUtil.getHour(result0['total_studytime'])+"小时");
                    $("#train_count").html(result0['train_count']+"次");

                }
            }
        });
    }
      //学员统计
      _this.student_tj = function () {
         var url = appPath + "/student/student_tj";
        $.ajax({
          url: url,
          async: false,
          type: "post",
          dataType:"json",
          success:function(data){
            var results = data['result'];

            if(results){
                var result0 = results[0];
                if(result0){
                    //$("#ndxs").html(TimeUtil.getHour(result0['year_studytime'])+"小时");
                    //$("#ljxs").html(TimeUtil.getHour(result0['total_studytime'])+"小时");
                   // $("#train_count").html(result0['train_count']+"次");
                    if(result0['pentName']){
                        var inner1 = '<div class="cell">'+result0['pentName']+'</div>';
                        inner1+='<div class="cell text-center">'+parseInt(result0['pentRank'])+'</div>'
                        $("#pent_name").html(inner1);
                    }
                    if(result0['prevName']){
                        var inner2 = '<div class="cell">'+result0['prevName']+'</div>';
                        inner2+='<div class="cell text-center">'+parseInt(result0['prevRank'])+'</div>'
                        $("#prev_name").html(inner2);
                    }

                    var inner = "";
                    for(var i=0; i<results.length; i++){
                        var result = results[i];
                        inner += '<div class="row">'
                        inner += '<div class="cell">'+result['company_name']+'</div>';
                        // inner += '<div class="cell text-center">'+result['rank_rule']+'</div>';
                        inner += '<div class="cell text-center">'+result['rownum']+'</div>';
                        inner += '</div>'
                    }
                    $("#div_student_info").append(inner);
                }
            }
          }
        });
      }

    //项目列表
    _this.initTable = function (isFixedCycle) {
        var list_url = "";
        if("1"==isFixedCycle){
            //周期性项目
            list_url = appPath + "/student/pu/list1";
        }else{
            //非周期性项目
            list_url = appPath + "/student/pu/list";
        }
        page.init("pu_form", list_url, "pu_table", "pu_page", 1, page_size);
        page.goPage(1);
        page.list = function(dataList){
            obj = dataList;
            // 组装数据
            var len = dataList.length;
            var inner = "", item;
            for(var i=0; i< len; i++) {
                item = dataList[i];
                /*if('1' == item['project_status']){
                    inner += "<tr style='display: none'>";
                }else{
                    inner += "<tr>";
                }*/
                inner += "<tr>";
                inner += "<td>" + (i+1) + "</td>";
                inner += "<td><span class=\"text-orange tooltip\" data-length='30'>" + item['project_name'] + "</span></td>";
                inner += "<td>" + Enum.projectType(item['project_type']) + "</td>";

                var projectType = item['project_type'];
                /*if(projectType == '3'){
                    inner += '<td>'+ TimeUtil.longMsTimeToDateTime3(item['project_start_time']) + '<br/>' + TimeUtil.longMsTimeToDateTime3(item['project_end_time']) + '</td>';
                }else{
                    inner += '<td>'+ TimeUtil.longMsTimeConvertToDateTime(item['project_start_time']) + '<br/>' + TimeUtil.longMsTimeConvertToDateTime(item['project_end_time']) + '</td>';
                }*/
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['project_start_time']) + "<br>" + TimeUtil.longMsTimeConvertToDateTime(item['project_end_time']) + "</td>";

                inner += "<td>" + Enum.projectStatus(item['project_status']) + "</td>";
                inner += "<td>" + item['create_user'] + "</td>";
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['create_time']) + "</td>";
                inner += "<td>";
                inner += '<a onclick="studentIndex.projectInfo(\'' + item.id + '\',\'' + item.project_mode + '\');" target="_blank" class="a a-info">详情</a>';
                if(item['project_status'] == '2' || item['project_status'] == '3'){
                    inner += '&nbsp;<a target="_blank" onclick="studentIndex.enterProject(\'' + item.id + '\',\''+ item.project_status + '\',\''+ item.project_type + '\');" class="a a-view">进入项目</a>';
                }else{
                    inner += '&nbsp;<a class="a" target="_blank">进入项目</a>';
                }
                inner += '&nbsp;<a target="_blank" onclick="studentIndex.projectRecord(\'' + item.id + '\',\''+ item.project_type + '\',\''+ item.project_status + '\');" class="a a-publish">查看记录</a>';
                projectStatus
                // 进行中 或 已结束的项目才可以打印学时
                if( '1457'.indexOf(projectType) != -1 ) {
                    if(item['project_status'] == '4' || item['project_status'] == '3'){
                        inner += '&nbsp;<a target="_blank"  class="a a-info" onclick="studentIndex.projectPrint(\'' + item.id + '\',this)">打印学时</a>';
                        if(item.hasOwnProperty("estimate")){
                            inner += '&nbsp;<a target="_blank"  class="a a-view" onclick="studentIndex.estimate(\'' + item.id + '\',this)">效果评估</a>';
                        }
                    }else{
                        inner += '&nbsp;<a class="a" onclick="studentIndex.prompt(\'' + item.id + '\',this)">打印学时</a>';
                    }
                }
                inner += "</td>";
                inner += "</tr>";
            }
            return inner;
        }
    }
    // 打印学时的提示信息
    _this.prompt = function () {
      layer.alert("对不起，待项目开始，方可下载学时证明。");
    }
    //可报名项目列表
    _this.initTable_public = function () {
        $("#public_pu_table").addClass("no");
        var list_url = appPath + "/student/pu/public_list";
        page1.init("public_pu_form", list_url, "public_pu_table", "public_pu_page", 1, page_size);
        page1.goPage(1);
        page1.list = function(dataList){
            $("#public_pu_table").removeClass("no");
            obj = dataList;
            // 组装数据
            var len = dataList.length;
            var inner = "", item;
            for(var i=0; i< len; i++) {
                item = dataList[i];
                inner += "<tr>";
                inner += "<td>" + (i+1) + "</td>";
                inner += "<td><span class=\"text-orange tooltip\" data-length='30'>" + item['project_name'] + "</span></td>";
                inner += "<td>" + Enum.projectType(item['project_type']) + "</td>";
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['project_start_time']) + "<br>" + TimeUtil.longMsTimeConvertToDateTime(item['project_end_time']) + "</td>";
                inner += "<td>" + Enum.projectStatus(item['project_status']) + "</td>";
                inner += "<td>" + item['create_user'] + "</td>";
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['create_time']) + "</td>";
                inner += "<td>";
                inner += '<a onclick="studentIndex.projectInfo(\'' + item.id + '\',\'' + 0 + '\');" target="_blank" class="a a-info">项目详情</a>';
                inner += '&nbsp;<a  target="_blank"  class="a a-view" onclick="studentIndex.projectSignUp(\'' + item['id'] + '\',\''+ item['project_type'] + '\',\''+ item['project_name'] + '\',\'' + item['project_mode'] + '\')">我要报名</a>';
                inner += "</td>";
                inner += "</tr>";
            }
            return inner;
        }
    }

    //查看项目详情
    _this.projectInfo = function(projectId,projectMode) {
        var url = appPath+"/student/ProjectInfo/student_info?projectId="+projectId+"&projectMode="+projectMode;
        window.open(url,"_blank");
        // window.location.href=appPath+"/student/ProjectInfo/student_info?projectId="+projectId+"&projectMode="+projectMode;
    }

    //查看集中培训项目详情
    _this.projectCenterTrain = function(projectId,projectMode) {
        var url = appPath+"/student/ProjectCenterTrain/student_center_info?projectId="+projectId;
        window.open(url,"_blank");
    }
    //进入项目
    _this.enterProject = function(projectId,projectStatus,projectType){
        if(projectStatus == '3'){
            var url ;
            if('3' == projectType){  // 进入单独的考试项目
                url =appPath+"/student/enterProject/student_enter_exam?projectId="+projectId;
            }else{                  // 进入非单独的考试项目
                url =appPath+"/student/enterProject/student_enter?projectId="+projectId;
            }
            window.open(url,"_blank");
        }else if (projectStatus == '2'){
            layer.msg("对不起，未开始的项目不能进入项目",{icon:5,time:1500});
        }else{
            layer.msg("对不起，已结束的项目不能进入项目",{icon:5,time:1500});
        }
    }
    //进入集中培训项目
    _this.enterCenterProject = function(projectId,projectStatus){
        if(projectStatus == '3'){
            // 进入非单独的考试项目
            window.open(appPath+"/student/enterProject/student_center_enter?projectId="+projectId, "_blank");
        }else if (projectStatus == '2'){
            layer.msg("对不起，未开始的项目不能进入项目",{icon:5,time:1500});
        }else{
            layer.msg("对不起，已结束的项目不能进入项目",{icon:5,time:1500});
        }
    }
    //查看记录
    _this.projectRecord = function(projectId,projectType,projectStatus) {
      if(projectStatus == '3' || projectStatus == '4'){
        var url =appPath+"/student/studentProjectRecord/project_record?projectId="+projectId+"&projectType="+projectType;
        window.open(url, "_blank");
      }else{
        layer.msg("对不起，未开始的项目不能查看记录",{icon:5,time:1500});
      }
    }

    //查看集中培训项目记录
    _this.projectCenterRecord = function(projectId,projectType,projectStatus) {
        if(projectStatus == '3' || projectStatus == '4'){
            window.open(appPath+"/student/studentProjectRecord/project_center_record?projectId="+projectId+"&projectType="+projectType, "_blank");
        }else{
            layer.msg("对不起，未开始的项目不能查看记录",{icon:5,time:1500});
        }
    }
   // 跳转到打印工程
    _this.projectPrint = function (project_id,obj) {
        var printTemplateJson = print_template_json;
        var raceProjectIds = race_project_ids;

        //非竞赛项目
        if($.inArray(project_id, raceProjectIds) == -1){
            var editLayer = "<div id='addLayer' style='padding-left: 20px;font-size: 20px;'>";
            editLayer +="<div style='line-height: 40px;' id='template'>";
            for(var i=0;i<printTemplateJson.length;i++){
                editLayer +=  "<label style='cursor: pointer;'> <input type='radio' ";
                if(i == 0){
                    editLayer += "checked='true'";
                }
                editLayer += " id='template' data-print-url='"+ printTemplateJson[i]['print_url'] +"'  name='template' value='" + printTemplateJson[i]['template_name'] + "'/>" + printTemplateJson[i]['template_name'] + "</label><br/>";
            }
            editLayer += "</div>";
            editLayer += "<div class='search-group layui-layer-close' style=' margin-top: 60px;margin-left: 80px;'><button class='btn btn-info' onclick='studentIndex.selectPrintTemplate(\""+ project_id +"\",1)' style='margin-right: 10px;'>确定</button>";
            editLayer += "<button class='btn btn-info layui-layer-close' onclick='studentIndex.closePrintTemplate(1)' style=''>关闭</button></div>";
            editLayer += "</div>";
            _this.index = layer.open({
                type: 1,
                title: '选择模板',
                shadeClose: true, // true点击遮罩层关闭
                area: ['380px', '280px'], // 弹出层大小
                scrollbar: false, // false隐藏滑动块
                content: editLayer
            });
        }else{
            var url = appPath + "/student/studentProjectRecord/project_print?project_id=" + project_id;
            $(obj).attr("href",url);
            $(obj).trigger("click");
        }

    };
    // 打印进入controller将参数加密
    _this.selectPrintTemplate = function (project_id,index) {

        var templateObj = $("#template input:radio[name='template']:checked");
        var print_url = templateObj.attr("data-print-url");
        window.open(appPath +"/popup/print?project_id="+ $.trim(project_id) +"&print_url="+print_url+"&train_type=1")
        layer.close(index);
    };
    // 打印关闭layer弹窗
    _this.closePrintTemplate = function (index) {
      layer.close(index);
    };

    // 报名
    _this.projectSignUp = function (projectId,projectType,projectName,projectMode) {
        var name = "<span style='font-size: larger;color: #FF5400'>&nbsp;"+projectName+"&nbsp;</span>"
        layer.confirm("确定要报名参加"+name+"吗?", {
            icon : 3,
            btn : [ "报名", "取消" ]
        }, function(index) {
            var projectRoles;
            $.ajax({
                url: appPath + '/popup/selectProjectRole',
                async: false,
                type: 'post',
                data: {
                    'projectId': projectId
                },
                success: function(data){
                    var code = data['code'];
                    if(10000 == code) {
                        projectRoles = data['result'];
                    }
                }
            });
            if(null!=projectRoles && projectRoles.length>0){
                layer.close(index);
                layer.open({
                    type: 2,
                    title: '选择受训角色报名',
                    area: ['450px', '300px'],		//弹出层大小
                    scrollbar: false,				//false隐藏滑动块
                    content: [appPath + "/popup/enterProjectRoleSelect?projectId="+projectId+"&projectType="+projectType+"&projectMode="+projectMode , 'yes']
                });
            }else {
                var roleId = "-1";
                var roleName="默认角色";
                $.ajax({
                    url: appPath + '/popup/save_project_user',
                    async: false,
                    type: 'post',
                    data: {
                        'id': projectId,       // 项目id
                        'roleId': roleId,      // 受训角色id
                        'roleName': roleName,  // 受训人员ids
                        'projectType': projectType,
                        'projectMode': projectMode
                    },
                    success: function(data){
                        var code = data['code'];
                        if(code==10000){
                            layer.msg('报名成功', {time:1000},function () {
                                parent.layer.close(parent.layer.getFrameIndex(window.name));
                                // 刷新项目列表
                                _this.initTable($("#isFixedCycle").val());
                                _this.initTable_public();
                            });
                        }else{
                            layer.msg('操作失敗', {time:1500},function () {
                                parent.layer.close(parent.layer.getFrameIndex(window.name));
                            });
                        }
                    }
                });
            }
        })
    }

    // 项目自定义排序
    _this.sort = function (value, obj,formName) {
        $("#"+formName +" #sortBy").val(value);
        var order = obj.className;
        if(order == 'sort asc'){
            $("#"+formName +" #descAsc").val('DESC')
        }else{
            $("#"+formName +" #descAsc").val('ASC')
        }
        if("pu_form" == formName){
            // 刷新列表
            _this.initTable($("#isFixedCycle").val());
        }
        if("off_form" == formName){
            // 刷新列表
            _this.initOffTable();
        }
        if("center_form" == formName){
            // 刷新列表
            _this.initCenterTable();
        }

    }

    _this.changeFixedCycle = function (obj) {
        $("#isFixedCycle").val($(obj).val());
        _this.initTable($(obj).val());
    }

    // 非周期性项目列表展示
    _this.noCycleProjectList = function(obj){
        $(".isFixedCycle").removeClass("active");
        $(obj).addClass("active");
        $("#on").removeClass("no");
        $("#off").addClass("no");
        $("#center").addClass("no");
        _this.initTable("2");
        proType = "online";
        $("#isFixedCycle").val("2");
    }
    // 周期性项目列表展示
    _this.cycleProjectList = function(obj){
        $(".isFixedCycle").removeClass("active");
        $(obj).addClass("active");
        $("#on").removeClass("no");
        $("#off").addClass("no");
        $("#center").addClass("no");
        _this.initTable("1");
        proType = "online";
        $("#isFixedCycle").val("1");
    }
    // 线上任务列表展示
    _this.projectOnList = function(obj){
        $(".projectStatus").removeClass("active");
        $(obj).addClass("active");
        $("#on").removeClass("no");
        $("#off").addClass("no");
        $("#center").addClass("no");
        $(".isFixedCycle").removeClass("no");
        proType = "online";
        _this.initTable($("#isFixedCycle").val());
    }
    // 线下任务列表
    _this.projectOffList = function(obj){
        $(".projectStatus").removeClass("active");
        $(obj).addClass("active");
        $("#on").addClass("no");
        $("#center").addClass("no");
        $("#off").removeClass("no");
        $(".isFixedCycle").addClass("no");
        proType = "offline";
        _this.initOffTable();
    }
    // 集中培训列表
    _this.projectCenterList = function(obj){
        $(".projectStatus").removeClass("active");
        $(obj).addClass("active");
        $("#on").addClass("no");
        $("#off").addClass("no");
        $("#center").removeClass("no");
        $(".isFixedCycle").addClass("no");
        proType = "centerLine";
        _this.initCenterTable();
    }

    //集中培训列表
    _this.initCenterTable = function () {
        var list_url = appPath + "/student/pu/center/list";
        page2.init("center_form", list_url, "center_table", "center_page", 1, page_size);
        page2.goPage(1);
        page2.list = function(dataList){
            obj = dataList;
            // 组装数据
            var len = dataList.length;
            var inner = "", item;
            for(var i=0; i< len; i++) {
                item = dataList[i];
                /*if('1' == item['project_status']){
                    inner += "<tr style='display: none'>";
                }else{
                    inner += "<tr>";
                }*/
                inner += "<tr>";
                inner += "<td>" + (i+1) + "</td>";
                inner += "<td><span class=\"text-orange tooltip\" data-length='30'>" + item['project_name'] + "</span></td>";
                inner += "<td>" + Enum.projectType(item['project_type']) + "</td>";

                var projectType = item['project_type'];
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['project_start_time']) + "<br>" + TimeUtil.longMsTimeConvertToDateTime(item['project_end_time']) + "</td>";

                inner += "<td>" + Enum.projectStatus(item['project_status']) + "</td>";
                inner += "<td>" + item['create_user'] + "</td>";
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['create_time']) + "</td>";
                inner += "<td>";
                inner += '<a target="_blank" onclick="studentIndex.projectCenterTrain(\'' + item.id + '\');" class="a a-info">详情</a>';
                if(item['project_type'] == '5' ){
                    inner += '&nbsp;<a target="_blank" onclick="studentIndex.enterCenterProject(\'' + item.id + '\',\''+ item.project_status + '\');" class="a a-view">进入项目</a>';
                }else{
                    inner += '&nbsp;<a target="_blank" type ="hidden" class="a">进入项目</a>';
                }
                inner += '&nbsp;<a target="_blank" onclick="studentIndex.projectCenterRecord(\'' + item.id + '\',\''+ item.project_type + '\',\''+ item.project_status + '\');" class="a a-publish">查看记录</a>';
                // 进行中 或 已结束的项目才可以打印学时
                if( '1457'.indexOf(projectType) != -1){
                    if(item['project_status'] == '4' || item['project_status'] == '3'){
                        /*inner += '&nbsp;<a  target="_blank"  class="a a-info" onclick="studentIndex.projectPrint(\'' + item.id + '\',this)">打印学时</a>';*/
                        if(item.hasOwnProperty("estimate")){
                            inner += '&nbsp;<a  target="_blank"  class="a a-view" onclick="studentIndex.estimate(\'' + item.id + '\',this)">效果评估</a>';
                        }
                    }else{
                       /* inner += '&nbsp;<a class="a" onclick="studentIndex.prompt(\'' + item.id + '\',this)">打印学时</a>';*/
                    }
                }
                inner += "</td>";
                inner += "</tr>";
            }
            return inner;
        }
    }

    //线下任务列表
    _this.initOffTable = function () {
        var list_url = appPath + "/student/pu/off/list";
        page2.init("off_form", list_url, "off_table", "off_page", 1, page_size);
        page2.goPage(1);
        page2.list = function(dataList){
            obj = dataList;
            // 组装数据
            var len = dataList.length;
            var inner = "", item;
            for(var i=0; i< len; i++) {
                item = dataList[i];
                console.log(item)
                inner += "<tr>";
                inner += "<td>" + (i+1) + "</td>";
                inner += "<td><span class=\"text-orange tooltip\" data-length='30'>" + item['project_name'] + "</span></td>";
                if(item['project_type'] == 1){
                    inner += "<td>培训</td>";
                }else{
                    inner += "<td>培训、考试</td>";
                }
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['project_start_time']) + "<br>" + TimeUtil.longMsTimeConvertToDateTime(item['project_end_time']) + "</td>";
                inner += "<td>" + Enum.projectStatus(item['project_status']) + "</td>";
                inner += "<td>" + item['create_user'] + "</td>";
                inner += "<td>" + TimeUtil.longMsTimeConvertToDateTime(item['create_time']) + "</td>";
                inner += "<td>";
                inner += '<a target="_blank" onclick="studentIndex.projectOffInfo(\'' + item.id + '\');" class="a a-info">详情</a>';
                inner += '&nbsp;<a target="_blank" onclick="studentIndex.processRecord(\'' + item.id + '\');" class="a a-view">过程记录</a>';
                if(item.hasOwnProperty("estimate") && ('3' == item.project_status || '4' == item.project_status)){
                    inner += '&nbsp;<a  target="_blank"  class="a a-view" onclick="studentIndex.estimate(\'' + item.id + '\',this)">效果评估</a>';
                }
                inner += "</td>";
                inner += "</tr>";
            }
            return inner;
        }
    }
    //查看线下项目详情
    _this.projectOffInfo = function(projectId) {
        var url = appPath+"/student/ProjectOff/projectOffInfo?projectId="+projectId;
        window.open(url,"_blank");
    }
    //查看过程记录
    _this.processRecord = function(projectId) {
        var url = appPath+"/student/ProjectOff/processRecord?projectId="+projectId;
        window.open(url,"_blank");
    }

    // 效果评估
    _this.estimate = function (projectId) {
        var param = {
            'projectId':projectId,
            'projectType':proType
        };

        // 已过评估期限，无法进行评估
        $.ajax({
            url: appPath + "/admin/projectEstimate/estimateAppraise",
            type: "POST",
            cache: false,
            async: false,
            data : param,
            success: function (data) {
                if('' == data.result){
                    // 答题评估页面
                    window.open(appPath+"/project/estimateQuestion/page?projectId=" + projectId,"_blank");
                }else{
                    layer.msg(data.result);
                }
            }
        });

    };

    _this.handlerPublish = function () {
        if ("1" == getCookie("studentPublishFlag")) return;
        $.ajax({
            url: appPath + "/student/message_notice",
            type: "POST",
            cache: false,
            async: false,
            dataType: "json",
            success: function (data) {
                var code = data.code;
                var result = data.result;
                if ( code == '10000') {
                    var unStudyProjectCount = result.unStudyProjectCount;
                    var messageCount = result.messageCount;
                    if(0 == (parseInt(unStudyProjectCount) + parseInt(messageCount))){
                        return;
                    }
                    setCookie("studentPublishFlag", "1");
                    var html = "<div class='box' id='addLayer' style='padding-left: 20px;font-size: 14px;width: 300px;'>";
                    html += "<div class='search-group' style=' margin-top: 0px;margin-left: -20px;'>";
                    if(0 != parseInt(messageCount) ){
                        html += "<div style=\"font-size: 15px;margin-bottom: 12px;font-weight: 700;color: rgb(221, 25, 25);\">待查看通知信息&nbsp;&nbsp;&nbsp;";
                        html += '<a href="'+ appPath +'/popup/msg" >'+ parseInt(messageCount) +'</a>'
                        html += "&nbsp;&nbsp;个</div>"
                    }
                    if(0 != parseInt(unStudyProjectCount) ){
                        html += "<div style=\"font-size: 15px;font-weight: 700;color: rgb(221, 25, 25);\">您有&nbsp;&nbsp;&nbsp;";
                        html += "<a href=''+ appPath +'/admin' >"+ parseInt(unStudyProjectCount) +"</a>"
                        html += "&nbsp;&nbsp;个项目未开始学习</div>"
                    }

                    html += "</div></div>";
                    layer.open({
                        title: '提示',
                        closeBtn: 0,
                        content: html,
                        scrollbar: false,
                        btn: ['知道了'],
                        yes: function (index) {
                            layer.close(index);
                            //location.href="#private_project_list";  //兼容ie跳转
                            //$("html,body").animate({scrollTop: $("#div_wjs_project").offset().top}, 1000);
                        }
                    });



                }
            }
        });
    };
}

var studentIndex = new StudentIndex();